//
// Created by jinbang.li on 2023/5/21.
//

#ifndef OPENPLAYDEMO_IOPDECODE_H
#define OPENPLAYDEMO_IOPDECODE_H

#include "../Observer/IOpObserver.h"
#include "../Data/OpParameter.h"
#include "../Data/OpData.h"
#include <list>
class IOpDecode: public IOpObserver{
public:
    ///打开解码器
    virtual bool Open(OpParameter opParameter,bool isHard = false) = 0;
    ///发送数据到线程解码
    virtual bool SendPacket(OpData opData) = 0;
    ///从线程中获取解码结果
    virtual OpData RecvFrame() = 0;

    virtual void update(OpData opData);

    bool isAudio = false;

    int maxList = 100;
protected:
    virtual void Main();
    std::list<OpData>packets;
    std::mutex packetMutex;
};


#endif //OPENPLAYDEMO_IOPDECODE_H
